#include <iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>

using namespace std;




void crearArray(int* vector){
	int i;
		
	// LLeno array
	for( i=0 ; i<256 ; i++ ){
		vector[i] = i;
	}	
}

void mostrarArray(int* vector){
	int i;
	
	for( i=0 ; i<256 ; i++ ){
		vector[i] = i;
		printf("[%d] = %d\n",i,vector[i]);
	}
}

int main(int argc, char **argv){
	
	int* vector = new int[256];
		
	crearArray(vector);
	
	//mostrarArray(vector);
	
	// Apertura de archivo de lectura
	ifstream inputFile;
	
	int file_size;
	
	int buffer_size = 15;
	char* buffer = new char[buffer_size];
	
	
	inputFile.open( "./inputFile.txt" , ios::binary );
	
	
	inputFile.seekg (0, ios::end);
	file_size = inputFile.tellg();
	inputFile.seekg (0, ios::beg);
	
	
	int cont = 0;
	int i=1;
	while( true ){
		cout << "Linea " << i++ << endl;
		
		cont+= buffer_size; cout << "Cont: " << cont << endl << endl;
		
		
		inputFile.read( buffer , buffer_size );
		
		cout << '"' << buffer << '"' << endl;
		
		
		if( cont >= file_size ){
			cout << "EOF" << endl;
			break;
		}
	}
	
	inputFile.close();
	
	delete[] buffer;
	delete[] vector;
}
